using System;

namespace EmraldClient
{
  public class ErrorViewModel : MyScreen
  {
    #region ' Message Property (change notification) '

    public string Message
    {
      get { return _message; }
      set
      {
        if (_message == value) return;
        _message = value;
        NotifyOfPropertyChange(() => Message);
      }
    }

    private string _message;

    #endregion

    public ErrorViewModel(Exception x)
    {
      while (x.InnerException != null)
        x = x.InnerException;

      _message = x.Message;
    }

    public void Accept()
    {
      OnDone(EventArgs.Empty);
    }
  }
}